package exer;

/**
 * @author tongchen
 * @create 2022-10-02 19:59
 */
public class LeecodeTesting {
    public int removeDuplicates(int[] nums) {
//注意题目前提条件：存在有序数组哦
        int i=0,j=0;
        while (j< nums.length){
            if (nums[i] == nums[j]) {
                j++;
            }
            else {
                i++;
                nums[i]=nums[j];
                j++;
            }
            }
        return i+1;
        }
    }

